package ru.padre386.geo_utils;

import ru.padre386.geo_utils.data_loaders.common.IGeoPoint;

/**
 * Created by IntelliJ IDEA.
 * User: indrdb
 * Date: 15.02.11
 * Time: 19:38
 */
public class VectorUtils {
    public double length3D(IGeoPoint x, IGeoPoint y) {
        return Math.sqrt(Math.pow((x.getLongitude() - y.getLongitude()), 2)
                + Math.pow(x.getLatitude() - y.getLatitude(), 2)
                + Math.pow((x.getAltitude() - y.getAltitude()), 2));
    }

    public double length2D(IGeoPoint x, IGeoPoint y) {
        return Math.sqrt(Math.pow((x.getLongitude() - y.getLongitude()), 2)
                + Math.pow(x.getLatitude() - y.getLatitude(), 2));
    }

}
